<#assign StringUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.StringUtils"]>
SELECT t.`PERMISSION_CODE`
FROM
c1_role_permission AS t
WHERE 1 = 1
<#--<#if StringUtils.isNotBlank(siteId)>-->
<#--AND EXISTS (SELECT 1 FROM C1_PERMISSION AS E WHERE E.ID = T.PERMISSION_ID AND E.SITE_ID = :siteId)-->
<#--</#if>-->
AND T.ROLE_ID = :roleId
ORDER BY LENGTH(t.`PERMISSION_CODE`) DESC
